package com.xingkeduo.pojo.enums;

import lombok.Getter;

@Getter
public enum CommentStar {
    ONE(1,"非常不满意，各方面都很差"),
    TWO(2,"不满意，比较差"),
    THREE(3,"一般，需要改善"),
    FOUR(4,"较满意，但仍可改善"),
    FIVE(5,"非常满意，会推荐给朋友");

    private int key;

    private String value;

    CommentStar(int key, String value) {
        this.key = key;
        this.value = value;
    }


   public static CommentStar getEnum(int num){
       for (CommentStar s : CommentStar.values())
           if(s.key==num){
               return s;
           }
       return null;
   }


    public static String getValue(int num){
        for (CommentStar s : CommentStar.values())
            if(s.key==num){
                return s.getValue();
            }
        return null;
    }

}
